home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / QDOffscreen.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  10.7 KB  |  438 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QDOffscreen.a
  3. ;
  4. ;    Contains:    Quickdraw Offscreen GWorld Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__QDOFFSCREEN__') = 'UNDEFINED' THEN
  18. __QDOFFSCREEN__ SET 1
  19.  
  20.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  21.     include 'Errors.a'
  22.     ENDIF
  23.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  24.     include 'Quickdraw.a'
  25.     ENDIF
  26.  
  27.  
  28. pixPurgeBit                        EQU        0
  29. noNewDeviceBit                    EQU        1
  30. useTempMemBit                    EQU        2
  31. keepLocalBit                    EQU        3
  32. pixelsPurgeableBit                EQU        6
  33. pixelsLockedBit                    EQU        7
  34. mapPixBit                        EQU        16
  35. newDepthBit                        EQU        17
  36. alignPixBit                        EQU        18
  37. newRowBytesBit                    EQU        19
  38. reallocPixBit                    EQU        20
  39. clipPixBit                        EQU        28
  40. stretchPixBit                    EQU        29
  41. ditherPixBit                    EQU        30
  42. gwFlagErrBit                    EQU        31
  43.  
  44. pixPurge                        EQU        $00000001
  45. noNewDevice                        EQU        $00000002
  46. useTempMem                        EQU        $00000004
  47. keepLocal                        EQU        $00000008
  48. pixelsPurgeable                    EQU        $00000040
  49. pixelsLocked                    EQU        $00000080
  50. kAllocDirectDrawSurface            EQU        $00004000
  51. mapPix                            EQU        $00010000
  52. newDepth                        EQU        $00020000
  53. alignPix                        EQU        $00040000
  54. newRowBytes                        EQU        $00080000
  55. reallocPix                        EQU        $00100000
  56. clipPix                            EQU        $10000000
  57. stretchPix                        EQU        $20000000
  58. ditherPix                        EQU        $40000000
  59. gwFlagErr                        EQU        $80000000
  60. ; typedef unsigned long                 GWorldFlags
  61.  
  62. ;  Type definition of a GWorldPtr 
  63. ; typedef CGrafPtr                         GWorldPtr
  64.  
  65. ;
  66. ; pascal QDErr NewGWorld(GWorldPtr *offscreenGWorld, short PixelDepth, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags)
  67. ;
  68.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  69.         Macro
  70.         _NewGWorld
  71.             move.l              #$00160000,D0
  72.             dc.w                $AB1D
  73.         EndM
  74.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  75.         IMPORT_CFM_FUNCTION NewGWorld
  76.     ENDIF
  77.  
  78.     IF ¬ TARGET_OS_MAC THEN
  79. ;  Quicktime 3.0 
  80.     IF TARGET_OS_WIN32 THEN
  81. ;  gdevice attribute bits
  82.  
  83. deviceIsIndirect                EQU        $00000001
  84. deviceNeedsLock                    EQU        $00000002
  85. deviceIsStatic                    EQU        $00000004
  86. deviceIsExternalBuffer            EQU        $00000008
  87. deviceIsDDSurface                EQU        $00000010
  88. deviceIsDCISurface                EQU        $00000020
  89. deviceIsGDISurface                EQU        $00000040
  90. deviceIsAScreen                    EQU        $00000080
  91. deviceIsOverlaySurface            EQU        $00000100
  92. ;
  93. ; pascal void *GetGDeviceSurface(GDHandle gdh)
  94. ;
  95.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  96.         IMPORT_CFM_FUNCTION GetGDeviceSurface
  97.     ENDIF
  98.  
  99. ;
  100. ; pascal unsigned long GetGDeviceAttributes(GDHandle gdh)
  101. ;
  102.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  103.         IMPORT_CFM_FUNCTION GetGDeviceAttributes
  104.     ENDIF
  105.  
  106. ;  to allocate non-mac-rgb GWorlds use QTNewGWorld (ImageCompression.h) 
  107. ;
  108. ; pascal QDErr NewGWorldFromHBITMAP(GWorldPtr *offscreenGWorld, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags, void *newHBITMAP, void *newHDC)
  109. ;
  110.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  111.         IMPORT_CFM_FUNCTION NewGWorldFromHBITMAP
  112.     ENDIF
  113.  
  114.     ENDIF    ; TARGET_OS_WIN32
  115. ;
  116. ; pascal QDErr NewGWorldFromPtr(GWorldPtr *offscreenGWorld, unsigned long PixelFormat, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags, Ptr newBuffer, long rowBytes)
  117. ;
  118.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  119.         IMPORT_CFM_FUNCTION NewGWorldFromPtr
  120.     ENDIF
  121.  
  122.     ENDIF
  123. ;
  124. ; pascal Boolean LockPixels(PixMapHandle pm)
  125. ;
  126.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  127.         Macro
  128.         _LockPixels
  129.             move.l              #$00040001,D0
  130.             dc.w                $AB1D
  131.         EndM
  132.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  133.         IMPORT_CFM_FUNCTION LockPixels
  134.     ENDIF
  135.  
  136. ;
  137. ; pascal void UnlockPixels(PixMapHandle pm)
  138. ;
  139.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  140.         Macro
  141.         _UnlockPixels
  142.             move.l              #$00040002,D0
  143.             dc.w                $AB1D
  144.         EndM
  145.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  146.         IMPORT_CFM_FUNCTION UnlockPixels
  147.     ENDIF
  148.  
  149. ;
  150. ; pascal GWorldFlags UpdateGWorld(GWorldPtr *offscreenGWorld, short pixelDepth, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags)
  151. ;
  152.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  153.         Macro
  154.         _UpdateGWorld
  155.             move.l              #$00160003,D0
  156.             dc.w                $AB1D
  157.         EndM
  158.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION UpdateGWorld
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal void DisposeGWorld(GWorldPtr offscreenGWorld)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  166.         Macro
  167.         _DisposeGWorld
  168.             move.l              #$00040004,D0
  169.             dc.w                $AB1D
  170.         EndM
  171.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  172.         IMPORT_CFM_FUNCTION DisposeGWorld
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal void GetGWorld(CGrafPtr *port, GDHandle *gdh)
  177. ;
  178.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  179.         Macro
  180.         _GetGWorld
  181.             move.l              #$00080005,D0
  182.             dc.w                $AB1D
  183.         EndM
  184.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  185.         IMPORT_CFM_FUNCTION GetGWorld
  186.     ENDIF
  187.  
  188. ;
  189. ; pascal void SetGWorld(CGrafPtr port, GDHandle gdh)
  190. ;
  191.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  192.         Macro
  193.         _SetGWorld
  194.             move.l              #$00080006,D0
  195.             dc.w                $AB1D
  196.         EndM
  197.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  198.         IMPORT_CFM_FUNCTION SetGWorld
  199.     ENDIF
  200.  
  201. ;
  202. ; pascal void CTabChanged(CTabHandle ctab)
  203. ;
  204.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  205.         Macro
  206.         _CTabChanged
  207.             move.l              #$00040007,D0
  208.             dc.w                $AB1D
  209.         EndM
  210.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  211.         IMPORT_CFM_FUNCTION CTabChanged
  212.     ENDIF
  213.  
  214. ;
  215. ; pascal void PixPatChanged(PixPatHandle ppat)
  216. ;
  217.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  218.         Macro
  219.         _PixPatChanged
  220.             move.l              #$00040008,D0
  221.             dc.w                $AB1D
  222.         EndM
  223.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  224.         IMPORT_CFM_FUNCTION PixPatChanged
  225.     ENDIF
  226.  
  227. ;
  228. ; pascal void PortChanged(GrafPtr port)
  229. ;
  230.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  231.         Macro
  232.         _PortChanged
  233.             move.l              #$00040009,D0
  234.             dc.w                $AB1D
  235.         EndM
  236.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  237.         IMPORT_CFM_FUNCTION PortChanged
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal void GDeviceChanged(GDHandle gdh)
  242. ;
  243.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  244.         Macro
  245.         _GDeviceChanged
  246.             move.l              #$0004000A,D0
  247.             dc.w                $AB1D
  248.         EndM
  249.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  250.         IMPORT_CFM_FUNCTION GDeviceChanged
  251.     ENDIF
  252.  
  253. ;
  254. ; pascal void AllowPurgePixels(PixMapHandle pm)
  255. ;
  256.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  257.         Macro
  258.         _AllowPurgePixels
  259.             move.l              #$0004000B,D0
  260.             dc.w                $AB1D
  261.         EndM
  262.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  263.         IMPORT_CFM_FUNCTION AllowPurgePixels
  264.     ENDIF
  265.  
  266. ;
  267. ; pascal void NoPurgePixels(PixMapHandle pm)
  268. ;
  269.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  270.         Macro
  271.         _NoPurgePixels
  272.             move.l              #$0004000C,D0
  273.             dc.w                $AB1D
  274.         EndM
  275.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  276.         IMPORT_CFM_FUNCTION NoPurgePixels
  277.     ENDIF
  278.  
  279. ;
  280. ; pascal GWorldFlags GetPixelsState(PixMapHandle pm)
  281. ;
  282.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  283.         Macro
  284.         _GetPixelsState
  285.             move.l              #$0004000D,D0
  286.             dc.w                $AB1D
  287.         EndM
  288.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  289.         IMPORT_CFM_FUNCTION GetPixelsState
  290.     ENDIF
  291.  
  292. ;
  293. ; pascal void SetPixelsState(PixMapHandle pm, GWorldFlags state)
  294. ;
  295.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  296.         Macro
  297.         _SetPixelsState
  298.             move.l              #$0008000E,D0
  299.             dc.w                $AB1D
  300.         EndM
  301.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  302.         IMPORT_CFM_FUNCTION SetPixelsState
  303.     ENDIF
  304.  
  305. ;
  306. ; pascal Ptr GetPixBaseAddr(PixMapHandle pm)
  307. ;
  308.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  309.         Macro
  310.         _GetPixBaseAddr
  311.             move.l              #$0004000F,D0
  312.             dc.w                $AB1D
  313.         EndM
  314.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  315.         IMPORT_CFM_FUNCTION GetPixBaseAddr
  316.     ENDIF
  317.  
  318. ;
  319. ; pascal long GetPixRowBytes(PixMapHandle pm)
  320. ;
  321.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  322.         Macro
  323.         _GetPixRowBytes
  324.             move.l              #$00040018,D0
  325.             dc.w                $AB1D
  326.         EndM
  327.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  328.         IMPORT_CFM_FUNCTION GetPixRowBytes
  329.     ENDIF
  330.  
  331. ;
  332. ; pascal QDErr NewScreenBuffer(const Rect *globalRect, Boolean purgeable, GDHandle *gdh, PixMapHandle *offscreenPixMap)
  333. ;
  334.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  335.         Macro
  336.         _NewScreenBuffer
  337.             move.l              #$000E0010,D0
  338.             dc.w                $AB1D
  339.         EndM
  340.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  341.         IMPORT_CFM_FUNCTION NewScreenBuffer
  342.     ENDIF
  343.  
  344. ;
  345. ; pascal void DisposeScreenBuffer(PixMapHandle offscreenPixMap)
  346. ;
  347.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  348.         Macro
  349.         _DisposeScreenBuffer
  350.             move.l              #$00040011,D0
  351.             dc.w                $AB1D
  352.         EndM
  353.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  354.         IMPORT_CFM_FUNCTION DisposeScreenBuffer
  355.     ENDIF
  356.  
  357. ;
  358. ; pascal GDHandle GetGWorldDevice(GWorldPtr offscreenGWorld)
  359. ;
  360.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  361.         Macro
  362.         _GetGWorldDevice
  363.             move.l              #$00040012,D0
  364.             dc.w                $AB1D
  365.         EndM
  366.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  367.         IMPORT_CFM_FUNCTION GetGWorldDevice
  368.     ENDIF
  369.  
  370. ;
  371. ; pascal Boolean QDDone(GrafPtr port)
  372. ;
  373.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  374.         Macro
  375.         _QDDone
  376.             move.l              #$00040013,D0
  377.             dc.w                $AB1D
  378.         EndM
  379.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  380.         IMPORT_CFM_FUNCTION QDDone
  381.     ENDIF
  382.  
  383. ;
  384. ; pascal long OffscreenVersion(void )
  385. ;
  386.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  387.         Macro
  388.         _OffscreenVersion
  389.             moveq               #20,D0
  390.             dc.w                $AB1D
  391.         EndM
  392.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  393.         IMPORT_CFM_FUNCTION OffscreenVersion
  394.     ENDIF
  395.  
  396. ;
  397. ; pascal QDErr NewTempScreenBuffer(const Rect *globalRect, Boolean purgeable, GDHandle *gdh, PixMapHandle *offscreenPixMap)
  398. ;
  399.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  400.         Macro
  401.         _NewTempScreenBuffer
  402.             move.l              #$000E0015,D0
  403.             dc.w                $AB1D
  404.         EndM
  405.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  406.         IMPORT_CFM_FUNCTION NewTempScreenBuffer
  407.     ENDIF
  408.  
  409. ;
  410. ; pascal Boolean PixMap32Bit(PixMapHandle pmHandle)
  411. ;
  412.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  413.         Macro
  414.         _PixMap32Bit
  415.             move.l              #$00040016,D0
  416.             dc.w                $AB1D
  417.         EndM
  418.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  419.         IMPORT_CFM_FUNCTION PixMap32Bit
  420.     ENDIF
  421.  
  422. ;
  423. ; pascal PixMapHandle GetGWorldPixMap(GWorldPtr offscreenGWorld)
  424. ;
  425.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  426.         Macro
  427.         _GetGWorldPixMap
  428.             move.l              #$00040017,D0
  429.             dc.w                $AB1D
  430.         EndM
  431.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  432.         IMPORT_CFM_FUNCTION GetGWorldPixMap
  433.     ENDIF
  434.  
  435.  
  436.     ENDIF ; __QDOFFSCREEN__ 
  437.  
  438.